home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: netcom.com!guzz
- From: guzz@netcom.com (Adam Gensler)
- Subject: Re: HELP Borland C++ 5.0 pointer problem
- Message-ID: <316e9fdb.457757@10.0.2.1>
- Sender: guzz@netcom16.netcom.com
- Organization: NETCOM On-line Communication Services (408 261-4700 guest)
- X-Newsreader: Forte Agent .99d/32.182
- References: <4klke8$7mb@dub-news-svc-2.compuserve.com>
- Date: Fri, 12 Apr 1996 18:31:06 GMT
-
- I'm not quite sure what you're trying to do, but it looks like you're
- trying to set your char * to the new buffer. That won't work because when you
- leave the function the memeory reserved for buffer[20] is marked as free. I
- think that's right.
-
- On Fri, 12 Apr 1996 21:04:49 GMT, 100660.2242@compuserve.com (Andy Graham)
- wrote:
-
- >Could you please tell me why the function below compiles and operates
- >correctly under win16 but not win32 ?
- >
- > char* test_function(char *in_data) {
- >
- > char buffer[20];
- > strcpy(buffer, in_data); // copy in_data to buffer
- > in_data = buffer; // set pointer to buffer
- >
- > return(in_data);
- >
- > } // end test_function function
-